package com.pigeon.crm.comm;

import java.util.List;

import org.hibernate.HibernateException;

import com.pigeon.crm.entity.CrmDictionary;
import com.pigeon.crm.entity.CrmUsers;
import com.pigeon.crm.entity.PageBean;


public interface IBaseService {
	
	public <T> void delete(T t) throws HibernateException;
	
	public <T> T get(Class<T> cls,java.io.Serializable id) ;
	
	public <T> void update(T t) throws HibernateException;
	
	public <T> void update(String hql,Object... objects) throws HibernateException;
	
	public <T> T savaOrUpdate(T t) throws HibernateException;
	
	public <T> T save(T t) throws HibernateException;
	
	public <T> List<T> findByHql(String hql,Object... objects) throws HibernateException;
	
	public <T> List<T> findByHqlWithPage(String hql,int start,int max) throws HibernateException;
	
	public PageBean queryForPage(int pageSize, int page, String hql); 
	
	public <T> List<CrmDictionary> findDictionryHql(String hql,Object... objects) throws HibernateException;
	
}
